package com.lagou.application;

import org.apache.catalina.LifecycleException;
import org.apache.catalina.connector.Connector;
import org.apache.catalina.startup.Tomcat;
import org.apache.tomcat.util.modeler.Registry;
import org.springframework.context.ConfigurableApplicationContext;

import java.io.File;
import java.io.IOException;
import java.util.Iterator;

/**
 * 用于启动springboot项目
 */
public class SpringApplication {

    public static void run() {
        Tomcat tomcat = new Tomcat();//new 一个tomcat实例
        try {
            tomcat.addWebapp("/","C:\\");
            tomcat.setPort(8080);
            tomcat.start();
            tomcat.getServer().await();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
